package com.thrd.taiexhibition.activity;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.thrd.basicframework.utils.ToastUtil;
import com.thrd.taiexhibition.R;
import com.thrd.taiexhibition.base.BackTitleActivity;
import com.thrd.taiexhibition.bean.BeanCityIndustryDetailCompany;
import com.thrd.taiexhibition.bean.BeanCityIndustryDetailCompanyData;
import com.thrd.taiexhibition.presener.CityIndustryDetailCompanyPresener;
import com.thrd.taiexhibition.ui.FocusIndustryCompanyInfoView;
import com.thrd.taiexhibition.view.CityIndustryDetailCompanyView;

/**
 * @author: ${唐杰}
 * @date: 2021/3/29
 */
@Route(path = "/app/cidca",group = "app")
public class CityIndustryDetailCompanyActivity extends BackTitleActivity implements CityIndustryDetailCompanyView {
    @Autowired(name="id")
    long id;

    @Autowired(name="industryDetailCompanyLocationImg")
    String industryDetailCompanyLocationImg;

    private FocusIndustryCompanyInfoView mFocusIndustryInfoView;
    private CityIndustryDetailCompanyPresener mCityIndustryDetailCompanyPresener;

    @Override
    protected int getLayout() {
        return R.layout.activity_industry_detail_company;
    }

    @Override
    protected void initView() {
        mFocusIndustryInfoView = (FocusIndustryCompanyInfoView) findViewById(R.id.tiv_image);

    }

    @Override
    protected void initData() {

            mCityIndustryDetailCompanyPresener = new CityIndustryDetailCompanyPresener(this);
//            mBeanCityIndustryDetail.getId()
            mCityIndustryDetailCompanyPresener.getCityFocusData(id);



        mFocusIndustryInfoView.setOnTouchImageListener(new FocusIndustryCompanyInfoView.OnTouchImageListener() {
            @Override
            public void onTouchImageListener(BeanCityIndustryDetailCompany mBeanCityIndustryDetail) {
                ToastUtil.show(CityIndustryDetailCompanyActivity.this,"mBeanCityIndustryDetail");
            }
        });
    }

    @Override
    protected void initEvent() {

    }

    @Override
    public void onError(String error, int type) {

    }

    @Override
    public void onSuccess(BeanCityIndustryDetailCompanyData mBeanCityIndustryDetailCompanyData) {
        mFocusIndustryInfoView.setTouchData(mBeanCityIndustryDetailCompanyData);
    }
}
